﻿#pragma once

#include "../../Shared/Data/ItemData.h"
#include <string>
#include <vector>
#include "../../stringhelper.h"

//C# TO C++ CONVERTER NOTE: Forward class declarations:
namespace Server::MirDatabase { class MineDrop; }

namespace Server::MirDatabase
{
    class MineSet
    {
    public:
        std::string Name = std::string::Empty;
        unsigned char SpotRegenRate = 5;
        unsigned char MaxStones = 80;
        unsigned char HitRate = 25;
        unsigned char DropRate = 10;
        unsigned char TotalSlots = 100;
        std::vector<MineDrop*> Drops = std::vector<MineDrop*>();
    private:
        bool DropsSet = false;

    public:
        MineSet(unsigned char mineType = 0);

        void SetDrops(std::vector<ItemInfo*> &items);
    };

    class MineSpot
    {
    public:
        unsigned char StonesLeft = 0;
        long long LastRegenTick = 0;
        MineSet *Mine;
        virtual ~MineSpot()
        {
            delete Mine;
        }

    };

    class MineDrop
    {
    public:
        std::string ItemName;
        ItemInfo *Item;
        unsigned char MinSlot = 0;
        unsigned char MaxSlot = 0;
        unsigned char MinDura = 1;
        unsigned char MaxDura = 1;
        unsigned char BonusChance = 0;
        unsigned char MaxBonusDura = 1;
        virtual ~MineDrop()
        {
            delete Item;
        }

    };

    class MineZone
    {
    public:
        unsigned char Mine = 0;
        Point *Location;
        unsigned short Size = 0;

        virtual ~MineZone()
        {
            delete Location;
        }

        MineZone();

        MineZone(BinaryReader *reader);

        void Save(BinaryWriter *writer);
        std::string ToString();
    };
}
